package com.itheima.pattern.visitor.fenpai;

/**
 * 动态分派
 */
public class Animal {
    public void execute(){
        System.out.println("动物");
    }
}

class Dog extends Animal{
    public void execute(){
        System.out.println("狗");
    }
}
class Cat extends Animal{

    @Override
    public void execute() {
        System.out.println("猫");
    }
}
